package hn.sigit.dao.hnd.administrative;

import java.io.Serializable;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;

import hn.sigit.dao.SigitDAO;
import hn.sigit.model.hnd.administrative.HND_Permit;


public class HND_PermitDAO extends SigitDAO<HND_Permit> implements Serializable {
	private static final long serialVersionUID = 1L;

	protected HND_PermitDAO() {
	}

	
	public static HND_Permit loadPermitByID(long permitId) {
		return loadPermitByID(getSession(), permitId);
	}

	public static HND_Permit loadPermitByID(Session session, long permitId) {
		Criteria criteria = session.createCriteria(HND_Permit.class);
		criteria.add(Restrictions.eq("id", permitId));
		
		return (HND_Permit) criteria.uniqueResult();
	}
}
